# !/usr/bin/env python
# coding: utf-8
# @Time   : 2022/11/27 21:12
# @Author : 梁灿

import os, sys
sys.path.append((os.path.abspath(os.path.join(os.path.dirname(__file__), '../../'))))

from page.basepage import BasePage
from common.readelement import Element


carmiConfigure = Element('carmiConfigure')  # 获取carmiConfigure.yml
print(carmiConfigure['点击卡密配置'])


class carmiConfigurePage(BasePage):
    """卡密配置"""
    # 新增球队
    def click_carmiConfigure(self):
        self.is_click(carmiConfigure['点击卡密配置'])

    def click_team_configure(self):
        self.is_click(carmiConfigure['点击球队配置'])

    def click_add(self):
        self.is_click(carmiConfigure['点击新增球队'])

    def input_teamName(self, content):
        self.input_text(carmiConfigure['输入球队名称'], content)

    def input_team_engname(self, content):
        self.input_text(carmiConfigure['输入英文名称'], content)

    def upload_team_picture(self,path,filename):
        self.upload_file(path=path,filename=filename,locator=carmiConfigure['上传球队图片'])

    def click_sure(self):
        self.is_click(carmiConfigure['点击确定'])

    # 新增球员
    def click_playerConfigure(self):
        self.is_click(carmiConfigure['点击球员管理'])

    def click_addPlayer(self):
        self.is_click(carmiConfigure['点击新增球员'])

    def input_playerName(self, content):
        self.input_text(carmiConfigure['输入球员中文名'], content)

    def input_player_engName(self, content):
        self.input_text(carmiConfigure['输入球员英文名'], content)

    def upload_play_picture(self,path,filename):
        self.upload_file(path=path,filename=filename,locator=carmiConfigure['上传球员图片'])

    def click_sure1(self):
        self.is_click(carmiConfigure['点击确定1'])

    # 新增厂商
    def click_factoryConfigure(self):
        self.is_click(carmiConfigure['点击厂商管理'])

    def click_addFactory(self):
        self.is_click(carmiConfigure['点击新增厂商'])

    def input_factoryName(self,content):
        self.input_text(carmiConfigure['输入厂商名称'], content)

    def click_sure2(self):
        self.is_click(carmiConfigure['点击确定2'])

    # 新增运动
    def click_sportConfigure(self):
        self.is_click(carmiConfigure['点击运动管理'])

    def click_addSport(self):
        self.is_click(carmiConfigure['点击新增运动'])

    def input_sportName(self,content):
        self.input_text(carmiConfigure['输入运动名称'], content)

    def click_sure3(self):
        self.is_click(carmiConfigure['点击确定3'])

    # 新增赛季
    def click_seasonConfigure(self):
        self.is_click(carmiConfigure['点击赛季管理'])

    def click_addSeason(self):
        self.is_click(carmiConfigure['点击新增赛季'])

    def input_seasonName(self,content):
        self.input_text(carmiConfigure['输入赛季名称'], content)

    def click_sure4(self):
        self.is_click(carmiConfigure['点击确定4'])


    # 新增系列
    def click_seriesConfigure(self):
        self.is_click(carmiConfigure['点击系列管理'])

    def click_addSeries(self):
        self.is_click(carmiConfigure['点击新增系列'])

    def input_seriesName(self,content):
        self.input_text(carmiConfigure['输入系列名称'], content)

    def choice_seasonName(self):
        self.is_click(carmiConfigure['选择赛季名称'])

    def get_seasonName(self):
        self.element_text(carmiConfigure['获取赛季下拉内容点击'])

    def choice_sportName(self):
        self.is_click(carmiConfigure['选择运动名称'])

    def choice_factoryName(self):
        self.is_click(carmiConfigure['选择厂商名称'])

    def click_sure5(self):
        self.is_click(carmiConfigure['点击确定5'])
